package jwtx

import (
	"crypto/ed25519"
	"crypto/x509"
	_ "embed"
	"encoding/pem"
)

//go:embed privateKey.pem
var privateKey []byte

//go:embed publicKey.pem
var publicKey []byte

func PrivateKey(privateKey []byte) ed25519.PrivateKey {
	p, _ := pem.Decode(privateKey)
	key, err := x509.ParsePKCS8PrivateKey(p.Bytes)
	if err != nil {
		panic(err)
	}
	e := key.(ed25519.PrivateKey)
	return e
}
